/**
 * userStatus
 *
 * 登陆的时候判断，login 接口中返回的userStatus
 * 0正常 1停用 3入驻中间态
 * 3的时候跳入驻界面
 */
export const USER_STATUS_OBJECT = {
  正常: 0,
  停用: 1,
  入驻中间态: 3,
};

/***
 * 系统类型 - 角色登陆 userType
 * ---------
 * PLATFORM("10", "平台方"),
 * DECORATION_COMPANY("21", "装修公司"),
 * MATERIALS_COMPANY("22", "家居建材"),
 * DESIGNER("23", "设计师"),
 * EMPLOYEE("24", "从业人员"),
 * CONSUMER("30", "消费者"),
 *
 * @key 与 DECORATION_COMPANY 的 key 一致
 */
export const SYSTEM_TYPE_OBJECT = {
  'P01': "平台方",
  'P02': '渠道合伙人',
  'P03': '高级合伙人',
  'MC00': "公司职员",
  'MC01': "服务商",
  'MC02': "装修公司",
  'MC03': "家居建材",
  'ME01': "设计师",
  'ME02': "项目经理",
  'ME03': "经纪人",
  'ME04': "销售员",
  'ME05': "工人",
  'C01': "消费者",
  'ANON': "匿名用户"
};

export const SYSTEM_TYPE_LIST = Object.keys(SYSTEM_TYPE_OBJECT).map((key) => ({
  label: SYSTEM_TYPE_OBJECT[key],
  value: key,
}));

// 反向获取 - 跟上面保持统一，key都不能随便改哦
export const SYSTEM_TYPE_REVERSE_OBJECT = {
  平台方: 'P01',
  渠道合伙人: 'P02',
  高级合伙人: 'P03',
  公司职员: 'MC00',
  服务商: 'MC01',
  装修公司: 'MC02',
  家居建材: 'MC03',
  项目经理: 'ME02',
  设计师: 'ME01',
  经纪人: 'ME03',
  销售员: 'ME04',
  工人: 'ME05',
  消费者: 'C01',
  匿名用户: 'ANON'
};

// 入驻类型的枚举，只有这三种身份需要入驻
export const SETTLE_TYPE_OBJECT = {
  MC02: "装修公司",
  MC03: "家居建材",
  ME01: "设计师",
  ME02: "项目经理",
};
export const SETTLE_TYPE_LIST = Object.keys(SETTLE_TYPE_OBJECT).map((key) => ({
  label: SETTLE_TYPE_OBJECT[key],
  value: key,
}));
/**
 * 装修公司进来：装修公司、设计机构/工作室
 * 家居建材进来：材料商、服务商
 * 设计师进来：设计师
 * 从业人员进来：从业人员
 * 消费者进来：消费者
 * @key 与 SYSTEM_TYPE_OBJECT 的 key 一致
 */
// 主体类型列表
export const SUBJECT_TYPE_ENUM = {
  21: [
    {
      label: "装修公司",
      value: "01",
    },
    {
      label: "设计机构",
      value: "02",
    },
    {
      label: "工作室",
      value: "03",
    },
  ],
  22: [
    {
      label: "材料商",
      value: "10",
    },
    {
      label: "服务商",
      value: "11",
    },
  ],
  23: [
    {
      label: "个人",
      value: "21",
    },
  ],
};
// 所有的主体类型
export const SUBJECT_TYPE_ENUM_ALL = Object.values(SUBJECT_TYPE_ENUM).flat();
export const SUBJECT_TYPE_ENUM_ALL_OBJECT = SUBJECT_TYPE_ENUM_ALL.reduce((acc, curr) => {
  acc[curr.value] = curr.label;
  return acc;
}, {});

export const COMPANY_PROPERTY_ENUM = [
  {
    label: "主体类型",
    fieldName: "subjectType",
  }, {
    label: "主经营品类",
    fieldName: "mainCategoryName",
  }, {
    label: "经营品类",
    fieldName: "categoryNames",
  }, {
    label: "经营品牌",
    fieldName: "manageBrandText",
  }, {
    label: "合伙人名称",
    fieldName: "mallName",
  },
  {
    label: "营业执照文件",
    fieldName: "businessLicenseFile",
    image: true,
  },
  {
    label: "统一社会信用代码",
    fieldName: "unifiedSocialCredit",
  },
  {
    label: "公司名称",
    fieldName: "companyName",
  },
  {
    label: "公司别名",
    fieldName: "companyAlias",
  },
  {
    label: "营业地址",
    fieldName: "businessAddress",
  },
  {
    label: "门店地址",
    fieldName: "storeAddress",
  },
  {
    label: "成立日期",
    fieldName: "licenseValidity",
  },
  {
    label: "商标或品牌授权",
    fieldName: "brandAuthorizationFile",
    image: true,
  },
  {
    label: "经营许可文件",
    fieldName: "businessPermitFile",
    image: true,
  },
  {
    label: "法人授权书",
    fieldName: "legalAuthorizationFile",
    image: true,
  },
  {
    label: "法人代表身份证正面",
    fieldName: "idCardFrontFile",
    image: true,
  },
  {
    label: "法人代表身份证反面",
    fieldName: "idCardBackFile",
    image: true,
  },
  {
    label: "法人代表姓名",
    fieldName: "legalRepresentative",
  },
  {
    label: "法人身份证号码",
    fieldName: "idNumber",
  },
  {
    label: "身份证有效期",
    fieldName: "idCardValidity",
  },
];
export const EMPLOYEE_PROPERTY_ENUM = [
  // {
  //   label: "主体类型",
  //   fieldName: "subjectType",
  // },
  {
    label: "合伙人名称",
    fieldName: "mallName",
  },
  {
    label: "姓名",
    fieldName: "nickname",
  },
  {
    label: "手机号",
    fieldName: "mobile",
  },
  {
    label: "身份证号码",
    fieldName: "idNumber",
  },
  {
    label: "身份证有效期",
    fieldName: "idCardValidity",
  },
  {
    label: "身份证正面",
    fieldName: "idCardFrontFile",
    image: true,
  },
  {
    label: "身份证反面",
    fieldName: "idCardBackFile",
    image: true,
  },
];
